<?php
session_start();
ob_start();
include_once 'include/common.php';
$core = new core();
if (!$core->CheckLogin()) {
    header('Location:login.php');
}
$list_exchange = $core->getListExchange();


?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>Zen store</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="Charisma, a fully featured, responsive, HTML5, Bootstrap admin template.">
    <meta name="author" content="Muhammad Usman">

    <!-- The styles -->
    <link id="bs-css" href="css/bootstrap-cerulean.css" rel="stylesheet">
    <style type="text/css">
        body {
            padding-bottom: 40px;
        }
        .sidebar-nav {
            padding: 9px 0;
        }
    </style>
    <link href="css/bootstrap-responsive.css" rel="stylesheet">
    <link href="css/charisma-app.css" rel="stylesheet">
    <link href="css/style.css" rel="stylesheet">
    <link href="css/jquery-ui-1.8.21.custom.css" rel="stylesheet">

    <link href='css/chosen.css' rel='stylesheet'>
    <link href='css/uniform.default.css' rel='stylesheet'>

    <link href='css/jquery.cleditor.css' rel='stylesheet'>


    <link href='css/jquery.iphone.toggle.css' rel='stylesheet'>

    <link href='css/uploadify.css' rel='stylesheet'>

    <!-- The HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
    <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->

    <!-- The fav icon -->
    <link rel="shortcut icon" href="img/favicon.ico">

</head>

<body>
<div id="page-wrap" class="page-wrap body-wrap ">
    <div id="page-tray" class="tray transition">
        <?php include_once ('new_menu.php'); ?>

        <div id="page-content" class="page-content transition profile-page">
            <?php include_once ('navbar.php'); ?>
            <div class="container-fluid">
                <div class="row-fluid">
                    <div id="content" class="span12">
                        <!--                                <div>
                                                            <ul class="breadcrumb">
                                                                <li>
                                                                    <a href="#">Home</a> <span class="divider">/</span>
                                                                </li>
                                                                <li>
                                                                    <a href="#">Forms</a>
                                                                </li>
                                                            </ul>
                                                        </div>-->
                        <?php
                        if ($_SESSION["user_role"] != 3) {
                            ?>
                            <div class="row-fluid sortable">
                                <div class="box span12">
                                    <div class="box-header well" data-original-title>
                                        <h2><i class="icon-edit"></i> Thêm tỉ giá</h2>

                                    </div>
                                    <div class="box-content">
                                        <form class="form-horizontal">
                                            <fieldset>
                                                <div class="control-group">
                                                    <label class="control-label" ></label>
                                                    <div class="controls">
                                                        <div class="alert alert-error" id="alert-error-category" style="display:none">
                                                        </div>
                                                        <div class="alert alert-success" id="alert-success-category" style="display:none"></div>
                                                    </div>
                                                </div>

                                                <div class="control-group">
                                                    <label class="control-label" for="exchange_value">Giá trị: </label>
                                                    <div class="control">
                                                        <div class="input-prepend input-append">
                                                            <input type="text" class="span6 typeahead" id="exchange_value"  >
                                                            <span class="add-on">VNĐ</span>
                                                            <br />Ví dụ: 30000 VNĐ
                                                        </div>
                                                    </div>
                                                </div>



                                                <div class="form-actions">
                                                    <button type="button" class="btn btn-primary" id="save_exchange">Save changes</button>
                                                    <button type="reset" class="btn">Cancel</button>
                                                </div>
                                            </fieldset>
                                        </form>

                                    </div>
                                </div><!--/span-->

                            </div><!--/row-->
                        <?php
                        }
                        ?>
                        <div class="row-fluid sortable">
                            <div class="box span12">
                                <div class="box-header well" data-original-title>
                                    <h2><i class="icon-user"></i>Lịch sử tỉ giá</h2>

                                </div>
                                <div class="box-content" id="box_content_customer_order" style="height: 400px;">

                                    <input type="hidden" name="category_id" id="category_id" value="0">
                                    <table class="table table-striped table-bordered bootstrap-datatable datatable" id="table_customer_order">
                                        <thead>
                                        <tr>
                                            <th>Tỉ giá</th>
                                            <th>Thời gian cập nhât</th>


                                        </tr>
                                        </thead>
                                        <tbody id="tbody_category_list">
                                        <?php
                                        if ($list_exchange) {
                                            foreach ($list_exchange as $data) {
                                                ?>
                                                <tr>
                                                    <td class="center" ><?php echo number_format($data->exchange); ?> VNĐ</td>
                                                    <td class="center"><?php echo date('d/m/Y h:i A',strtotime($data->created_time)); ?></td>


                                                </tr>
                                            <?php
                                            }
                                        }
                                        ?>
                                        </tbody>
                                    </table>
                                    <div id="loading" style="display:none;width: 220px; height: 19px;margin: 0 auto;"><img title="img/ajax-loaders/ajax-loader-7.gif" src="img/ajax-loaders/ajax-loader-7.gif"></div>
                                </div>
                            </div><!--/span-->

                        </div><!--/row-->

                    </div><!--/#content.span10-->

                </div><!--/fluid-row-->
                <?php include_once ('footer.php'); ?>

            </div><!--/.fluid-container-->
        </div>
    </div>
</div>

<!-- external javascript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->

<!-- jQuery -->
<script src="js/jquery-1.7.2.min.js"></script>
<!-- jQuery UI -->
<script src="js/jquery-ui-1.8.21.custom.min.js"></script>
<!-- transition / effect library -->
<script src="js/bootstrap-transition.js"></script>
<!-- alert enhancer library -->
<script src="js/bootstrap-alert.js"></script>

<!-- library for creating tabs -->
<script src="js/bootstrap-tab.js"></script>
<!-- library for advanced tooltip -->
<script src="js/bootstrap-tooltip.js"></script>
<!-- popover effect library -->
<script src="js/bootstrap-popover.js"></script>

<script src="js/bootstrap-collapse.js"></script>

<script src="js/jquery.cookie.js"></script>


<!-- select or dropdown enhancer -->
<script src="js/jquery.chosen.min.js"></script>
<!-- checkbox, radio, and file input styler -->
<script src="js/jquery.uniform.min.js"></script>

<script src="js/jquery.cleditor.min.js"></script>

<script src="js/jquery.iphone.toggle.js"></script>
<!-- autogrowing textarea plugin -->
<script src="js/jquery.autogrow-textarea.js"></script>
<!-- multiple file upload plugin -->
<script src="js/jquery.uploadify-3.1.min.js"></script>
<!-- history.js for cross-browser state change on ajax -->
<script src="js/jquery.history.js"></script>
<!-- application script for Charisma demo -->
<script src="js/common.js?t=1"></script>
<script src="js/addExchange.js?t=1"></script>



</body>
</html>

